<div class="loader">
  <div class="cubes">
    <div class="cube">
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
    </div>
    <div class="cube">
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
    </div>
    <div class="cube">
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
    </div>
    <div class="cube">
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
      <div class="side"></div>
    </div>
  </div>
</div>
<style>
/* From Uiverse.io by Pradeepsaranbishnoi - Tags: loader */
/* The loader container */
.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  margin-left: -100px;
  perspective: 1000px;
  transform-style: preserve-3d;
}


/* The cubes */
.cubes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(45deg) rotateZ(45deg);
}


/* The cube */
.cube {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 50%;
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
  transform: translateZ(-50px);
  animation: cube 2500ms cubic-bezier(.66,.14,.56,.75) infinite;
}

.cube:nth-child(2) {
  top: 0;
  left: 50%;
  animation-delay: 50ms;
}

.cube:nth-child(3) {
  top: 50%;
  left: 0;
  animation-delay: 100ms;
}

.cube:nth-child(4) {
  top: 50%;
  left: 50%;
  animation-delay: 150ms;
}

@keyframes cube {
  0%, 75%, 100% {
    transform: translate3d(0px, 0px, 50px) rotateY(0deg) scale3d(0.9, 0.9, 0.1);
  }

  25%, 50% {
    transform: translate3d(0px, 0px, -50px) rotateY(180deg) scale3d(0.9, 0.9, 0.1);
  }
}





/* The side */
.side {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* back */
.side:nth-child(1) {
  transform: rotateX(-180deg) translateZ(50px);
  background-color: #1e3f57;
}

/* left side */
.side:nth-child(2) {
  transform: rotateY(-90deg) translateZ(50px);
  background-color: #6bb2cd;
}

/* right side */
.side:nth-child(3) {
  transform: rotateY(90deg) translateZ(50px);
  background-color: #6bb2cd;
}

/* top side */
.side:nth-child(4) {
  transform: rotateX(90deg) translateZ(50px);
  background-color: #3c617d;
}

/* bottom side */
.side:nth-child(5) {
  transform: rotateX(-90deg) translateZ(50px);
  background-color: #3c617d;
}

/* top */
.side:nth-child(6) {
  transform: translateZ(50px);
  background-color: #1e3f57;
}

</style>
